﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DesignPattern.CompositePattern03._02
{
    public class CompositePattern02
    {
        public static void Run()
        {
            Console.WriteLine("组合模式2");
            Graphics graphics = new Graphics("全部图形");

            Circle circle = new Circle("圆形", 5);
            graphics.Add(circle);

            Rectangle rectangle = new Rectangle("矩形", 4, 5);
            graphics.Add(rectangle);

            Triangle triangle = new Triangle("三角形", 3, 4, 5);
            graphics.Add(triangle);

            graphics.Display();
        }
    }
}
